package com.rj.framework.biz.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 自定义校验注解示例
 */
@Target({FIELD, METHOD, PARAMETER, ANNOTATION_TYPE, TYPE_USE})
@Retention(RUNTIME)
@Constraint(validatedBy = {TenantResourceValidator.class})
public @interface TenantResource {
    String message() default "Resource does not belong to current tenant";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}